Skip to content

Conversation

@limotova
Copy link
Contributor

@limotova limotova commented Mar 19, 2025

Previously if an aggregate_metric_double was present amongst fields and
you tried to sort on any (not necessarily even on the agg_metric itself)
field in ES|QL, it would break the results.

This commit doesn't add support for sorting on aggregate_metric_double
(it is unclear what aspect would be sorted), but it fixes the previous
behavior.

@limotova limotova force-pushed the fix-sorting-with-agg-metric branch 2 times, most recently from d19a1ee to 5946e82 Compare March 25, 2025 08:26
Previously if an aggregate_metric_double was present amongst fields and
you tried to sort on any (not necessarily even on the agg_metric itself)
field in ES|QL, it would break the results.

This commit doesn't add support for sorting _on_ aggregate_metric_double
(it is unclear what aspect would be sorted), but it fixes the previous
behavior.
@limotova limotova force-pushed the fix-sorting-with-agg-metric branch from 5946e82 to 8604600 Compare March 26, 2025 02:39
@limotova limotova changed the title fix sorting [ES|QL] Fix sorting when aggregate_metric_double present Mar 26, 2025
@dnhatn dnhatn self-requested a review March 27, 2025 00:04
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Larisa! I think I have a concern: we now assume that the composite block is an aggregation_metric_double block in many places.

@limotova
Copy link
Contributor Author

I think I have a concern: we now assume that the composite block is an aggregation_metric_double block in many places.

We do indeed... maybe we should introduce a new block type or add some additional information to composite blocks to say what they're representing?

@limotova limotova marked this pull request as ready for review March 28, 2025 07:36
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Mar 28, 2025
@limotova limotova added :Analytics/ES|QL AKA ESQL >enhancement and removed needs:triage Requires assignment of a team area label labels Mar 28, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Mar 28, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @limotova, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Larisa!

maybe we should introduce a new block type or add some additional information to composite blocks to say what they're representing?

I'm also a little bit worried that the generic CompositeBlock now has very specific usages. Maybe introducing CompositeType enum and adding as a field to CompositeBlock is suffcient? (

@dnhatn
Copy link
Member

dnhatn commented Mar 28, 2025

Maybe introducing CompositeType enum and adding as a field to CompositeBlock is suffcient? (

++. We can do it in a follow-up @limotova.

@limotova limotova merged commit b4f534c into elastic:main Mar 28, 2025
17 checks passed
@limotova limotova deleted the fix-sorting-with-agg-metric branch March 28, 2025 20:16
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
)

Previously if an aggregate_metric_double was present amongst fields and
you tried to sort on any (not necessarily even on the agg_metric itself)
field in ES|QL, it would break the results.

This commit doesn't add support for sorting _on_ aggregate_metric_double
(it is unclear what aspect would be sorted), but it fixes the previous
behavior.
limotova added a commit to limotova/elasticsearch that referenced this pull request Apr 8, 2025
)

Previously if an aggregate_metric_double was present amongst fields and
you tried to sort on any (not necessarily even on the agg_metric itself)
field in ES|QL, it would break the results.

This commit doesn't add support for sorting _on_ aggregate_metric_double
(it is unclear what aspect would be sorted), but it fixes the previous
behavior.
elasticsearchmachine pushed a commit that referenced this pull request Apr 8, 2025
* [ES|QL] ToAggregateMetricDouble function (#124595)

This commit adds a conversion function from numerics (and aggregate
metric doubles) to aggregate metric doubles.

It is most useful when you have multiple indices, where one index uses
aggregate metric double (e.g. a downsampled index) and another uses a
normal numeric type like long or double (e.g. an index prior to
downsampling).

* remove old docs

* [ES|QL] Add ToAggregateMetricDouble example (#125518)

Adds AggregateMetricDouble to the ES|QL CSV tests and examples of how to
use the ToAggregateMetricDouble function

* [ES|QL] Fix sorting when aggregate_metric_double present (#125191)

Previously if an aggregate_metric_double was present amongst fields and
you tried to sort on any (not necessarily even on the agg_metric itself)
field in ES|QL, it would break the results.

This commit doesn't add support for sorting _on_ aggregate_metric_double
(it is unclear what aspect would be sorted), but it fixes the previous
behavior.

* drop old style docs again

* add new style docs

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >enhancement :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants